|
nanobeacon 2.2.0
|
API for configuring and manipulating NanoBeacon Click driver. More...
Topics | |
| NanoBeacon Device Settings | |
| Settings for registers of NanoBeacon Click driver. | |
| NanoBeacon MikroBUS Map | |
| MikroBUS pin mapping of NanoBeacon Click driver. | |
Functions | |
| void | nanobeacon_cfg_setup (nanobeacon_cfg_t *cfg) |
| NanoBeacon configuration object setup function. | |
| err_t | nanobeacon_init (nanobeacon_t *ctx, nanobeacon_cfg_t *cfg) |
| NanoBeacon initialization function. | |
| err_t | nanobeacon_generic_write (nanobeacon_t *ctx, uint8_t *data_in, uint16_t len) |
| NanoBeacon data writing function. | |
| err_t | nanobeacon_generic_read (nanobeacon_t *ctx, uint8_t *data_out, uint16_t len) |
| NanoBeacon data reading function. | |
| uint8_t | nanobeacon_get_an_pin (nanobeacon_t *ctx) |
| NanoBeacon get an pin function. | |
| void | nanobeacon_set_en_pin (nanobeacon_t *ctx, uint8_t state) |
| NanoBeacon set EN pin function. | |
| void | nanobeacon_set_dq_pin (nanobeacon_t *ctx, uint8_t state) |
| NanoBeacon set DQ pin function. | |
| void | nanobeacon_restart_device (nanobeacon_t *ctx) |
| NanoBeacon restart device function. | |
| err_t | nanobeacon_send_packet (nanobeacon_t *ctx, nanobeacon_packet_t pkt_in) |
| NanoBeacon send packet function. | |
| err_t | nanobeacon_read_packet (nanobeacon_t *ctx, nanobeacon_packet_t *pkt_out) |
| NanoBeacon read packet function. | |
| err_t | nanobeacon_check_communication (nanobeacon_t *ctx) |
| NanoBeacon check communication function. | |
| err_t | nanobeacon_write_reg (nanobeacon_t *ctx, uint16_t address, uint32_t data_in) |
| NanoBeacon write reg function. | |
| err_t | nanobeacon_read_reg (nanobeacon_t *ctx, uint16_t address, uint32_t *data_out) |
| NanoBeacon read reg function. | |
| err_t | nanobeacon_write_mem (nanobeacon_t *ctx, uint16_t address, uint32_t data_in) |
| NanoBeacon write mem function. | |
| err_t | nanobeacon_read_mem (nanobeacon_t *ctx, uint16_t address, uint32_t *data_out) |
| NanoBeacon read mem function. | |
| err_t | nanobeacon_write_efuse (nanobeacon_t *ctx, uint8_t aid, uint16_t data_in) |
| NanoBeacon write efuse function. | |
| err_t | nanobeacon_read_efuse (nanobeacon_t *ctx, uint8_t aid, uint16_t *data_out) |
| NanoBeacon read efuse function. | |
| err_t | nanobeacon_set_advertising (uint8_t *mac_address, uint16_t interval, uint8_t *adv_raw_data, uint8_t len) |
| NanoBeacon set advertising function. | |
| err_t | nanobeacon_load_adv_to_ram (nanobeacon_t *ctx) |
| NanoBeacon load adv to ram function. | |
| err_t | nanobeacon_start_advertising (nanobeacon_t *ctx) |
| NanoBeacon start advertising function. | |
API for configuring and manipulating NanoBeacon Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
| void nanobeacon_cfg_setup | ( | nanobeacon_cfg_t * | cfg | ) |
NanoBeacon configuration object setup function.
This function initializes Click configuration structure to initial values.
| [out] | cfg | : Click configuration structure. See nanobeacon_cfg_t object definition for detailed explanation. |
| err_t nanobeacon_check_communication | ( | nanobeacon_t * | ctx | ) |
NanoBeacon check communication function.
This function checks the communication by sending the ready request command.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_generic_read | ( | nanobeacon_t * | ctx, |
| uint8_t * | data_out, | ||
| uint16_t | len ) |
NanoBeacon data reading function.
This function reads a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [out] | data_out | : Output read data. |
| [in] | len | : Number of bytes to be read. |
>0 - Number of data bytes read, <=0 - Error/Empty Ring buffer. See #err_t definition for detailed explanation. | err_t nanobeacon_generic_write | ( | nanobeacon_t * | ctx, |
| uint8_t * | data_in, | ||
| uint16_t | len ) |
NanoBeacon data writing function.
This function writes a desired number of data bytes by using UART serial interface.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | data_in | : Data buffer for sending. |
| [in] | len | : Number of bytes for sending. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | uint8_t nanobeacon_get_an_pin | ( | nanobeacon_t * | ctx | ) |
NanoBeacon get an pin function.
This function returns the AN pin logic state.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| err_t nanobeacon_init | ( | nanobeacon_t * | ctx, |
| nanobeacon_cfg_t * | cfg ) |
NanoBeacon initialization function.
This function initializes all necessary pins and peripherals used for this Click board.
| [out] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | cfg | : Click configuration structure. See nanobeacon_cfg_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_load_adv_to_ram | ( | nanobeacon_t * | ctx | ) |
NanoBeacon load adv to ram function.
This function loads advertising data to RAM.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_read_efuse | ( | nanobeacon_t * | ctx, |
| uint8_t | aid, | ||
| uint16_t * | data_out ) |
NanoBeacon read efuse function.
This function reads data from the selected efuse aid.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | aid | : 1-byte efuse aid. |
| [out] | data_out | : 2-byte data read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_read_mem | ( | nanobeacon_t * | ctx, |
| uint16_t | address, | ||
| uint32_t * | data_out ) |
NanoBeacon read mem function.
This function reads data from the selected memory address.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | address | : 2-byte memory address. |
| [out] | data_out | : 4-byte data read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_read_packet | ( | nanobeacon_t * | ctx, |
| nanobeacon_packet_t * | pkt_out ) |
NanoBeacon read packet function.
This function reads a response data packet by using UART serial interface.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [out] | pkt_out | : Response data packet. See nanobeacon_packet_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_read_reg | ( | nanobeacon_t * | ctx, |
| uint16_t | address, | ||
| uint32_t * | data_out ) |
NanoBeacon read reg function.
This function reads data from the selected register address.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | address | : 2-byte register address. |
| [out] | data_out | : 4-byte data read. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void nanobeacon_restart_device | ( | nanobeacon_t * | ctx | ) |
NanoBeacon restart device function.
This function restarts the device by toggling the EN pin.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| err_t nanobeacon_send_packet | ( | nanobeacon_t * | ctx, |
| nanobeacon_packet_t | pkt_in ) |
NanoBeacon send packet function.
This function sends a command data packet by using UART serial interface.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | pkt_in | : Command data packet. See nanobeacon_packet_t object definition for detailed explanation. |
>=0 - Success, <0 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_set_advertising | ( | uint8_t * | mac_address, |
| uint16_t | interval, | ||
| uint8_t * | adv_raw_data, | ||
| uint8_t | len ) |
NanoBeacon set advertising function.
This function sets the device MAC address, interval and advertising raw data.
| [in] | mac_address | : 6-byte device MAC address (should not be set to all zeros or ones). |
| [in] | interval | : Broadcast interval in milliseconds. |
| [in] | adv_raw_data | : Advertising raw data buffer (up to 31 bytes). |
| [in] | len | : Lenght of advertising raw data buffer. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | void nanobeacon_set_dq_pin | ( | nanobeacon_t * | ctx, |
| uint8_t | state ) |
NanoBeacon set DQ pin function.
This function sets the DQ pin logic state.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| void nanobeacon_set_en_pin | ( | nanobeacon_t * | ctx, |
| uint8_t | state ) |
NanoBeacon set EN pin function.
This function sets the EN pin logic state.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | state | : Pin logic state. |
| err_t nanobeacon_start_advertising | ( | nanobeacon_t * | ctx | ) |
NanoBeacon start advertising function.
This function starts the advertising.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_write_efuse | ( | nanobeacon_t * | ctx, |
| uint8_t | aid, | ||
| uint16_t | data_in ) |
NanoBeacon write efuse function.
This function writes a desired data to the selected efuse aid.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | aid | : 1-byte efuse aid. |
| [in] | data_in | : 2-byte data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_write_mem | ( | nanobeacon_t * | ctx, |
| uint16_t | address, | ||
| uint32_t | data_in ) |
NanoBeacon write mem function.
This function writes a desired data to the selected memory address.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | address | : 2-byte memory address. |
| [in] | data_in | : 4-byte data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation. | err_t nanobeacon_write_reg | ( | nanobeacon_t * | ctx, |
| uint16_t | address, | ||
| uint32_t | data_in ) |
NanoBeacon write reg function.
This function writes a desired data to the selected register address.
| [in] | ctx | : Click context object. See nanobeacon_t object definition for detailed explanation. |
| [in] | address | : 2-byte register address. |
| [in] | data_in | : 4-byte data to be written. |
0 - Success, -1 - Error. See #err_t definition for detailed explanation.